﻿<Application 
    x:Class="Social_Photos.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:inputToolkit="clr-namespace:System.Windows.Controls" xmlns:inputToolkitPrimitives="clr-namespace:System.Windows.Controls.Primitives">

    <!--Application Resources-->
    <Application.Resources>
        <Style x:Key="RatingItemLeftStyle" TargetType="inputToolkit:RatingItem">
            <Setter Property="BorderBrush" Value="#FF545454"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="inputToolkit:RatingItem">
                        <Grid Background="{TemplateBinding Background}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                                        <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Normal"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverRatingItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard/>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="ReadOnly"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard/>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FillStates">
                                    <VisualState x:Name="Empty"/>
                                    <VisualState x:Name="Partial"/>
                                    <VisualState x:Name="Filled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Background="#02FFFFFF" BorderThickness="0"/>
                            <Path Width="20" x:Name="DefaultRatingItem" Stretch="Fill" StrokeLineJoin="Round" StrokeThickness="0.4" VerticalAlignment="Stretch"  Opacity="1" UseLayoutRounding="False" Data="M15,0 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z" Fill="#FFE5E5E5"/>
                            <inputToolkitPrimitives:LinearClipper RatioVisible="{TemplateBinding DisplayValue}" ExpandDirection="Right">
                                <Path Width="20" Fill="{TemplateBinding Foreground}" Stretch="Fill" StrokeLineJoin="Round" StrokeThickness="0.4" VerticalAlignment="Stretch" Opacity="1" UseLayoutRounding="False" Data="M15,0 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
                            </inputToolkitPrimitives:LinearClipper>
                            <Path Width="20" x:Name="MouseOverRatingItem" Fill="Black" Stretch="Fill" StrokeLineJoin="Round" StrokeThickness="0.4" HorizontalAlignment="Left" VerticalAlignment="Stretch"  Opacity="0" UseLayoutRounding="False" Data="M15,0 L15,23.023449 L5.7294912,30 L9.1750822,18.573566 L0,11.459046 L11.399999,11.373603 z"/>
                            <ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="RatingItemRightStyle" TargetType="inputToolkit:RatingItem">
            <Setter Property="BorderBrush" Value="#FF545454"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="inputToolkit:RatingItem">
                        <Grid Background="{TemplateBinding Background}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="00:00:00.1000000"/>
                                        <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Normal"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverRatingItem" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard/>
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="ReadOnly"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard/>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FillStates">
                                    <VisualState x:Name="Empty"/>
                                    <VisualState x:Name="Partial"/>
                                    <VisualState x:Name="Filled"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Background="#02FFFFFF" BorderThickness="0"/>
                            <Path Width="20" x:Name="DefaultRatingItem" Fill="#FFE7E7E7" Stretch="Fill" StrokeLineJoin="Round" StrokeThickness="0.4" VerticalAlignment="Stretch" Opacity="1" UseLayoutRounding="False" Data="M0,11.459028 z M15,0 L18.599995,11.373585 L29.999994,11.459028 L20.824949,18.573547 L24.270514,29.999981 L15,23.023434 z" />
                            <inputToolkitPrimitives:LinearClipper RatioVisible="{TemplateBinding DisplayValue}" ExpandDirection="Right">
                                <Path Width="20" x:Name="DefaultRatingItem_Copy" Fill="{TemplateBinding Foreground}" Stretch="Fill" StrokeLineJoin="Round" StrokeThickness="0.4" VerticalAlignment="Stretch" Opacity="1" UseLayoutRounding="False" Data="M0,11.459028 z M15,0 L18.599995,11.373585 L29.999994,11.459028 L20.824949,18.573547 L24.270514,29.999981 L15,23.023434 z" />
                            </inputToolkitPrimitives:LinearClipper>
                            <Path Width="20" x:Name="MouseOverRatingItem" Fill="Black" Stretch="Fill" StrokeLineJoin="Round" StrokeThickness="0.4" VerticalAlignment="Stretch" Opacity="0" UseLayoutRounding="False" Data="M0,11.459028 z M15,0 L18.599995,11.373585 L29.999994,11.459028 L20.824949,18.573547 L24.270514,29.999981 L15,23.023434 z"/>
                            <ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>